package com.xd.pre.modules.tpshop.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.xd.pre.modules.tpshop.domain.TpCoupon;
import com.xd.pre.modules.tpshop.domain.TpShipping;
import com.xd.pre.modules.tpshop.mapper.TpShippingMapper;
import com.xd.pre.modules.tpshop.service.ITpShippingService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lx
 * @since 2020-06-03
 */
@Service
public class TpShippingServiceImpl extends ServiceImpl<TpShippingMapper, TpShipping> implements ITpShippingService {

    @Override
    public TpShipping find_byKeyId(Integer shippingId) {
        return getById(shippingId);
    }

    @Override
    public TpShipping find_cart_byshipping_code(String shipping_code) {
        LambdaQueryWrapper<TpShipping> lambdaQuery = Wrappers.lambdaQuery();
        lambdaQuery.eq(TpShipping::getShippingCode, shipping_code);
        TpShipping one = getOne(lambdaQuery);
        return one;
    }
}
